package com.heima.apis.wemedia;

import com.heima.model.admin.dtos.ChannelDto;
import com.heima.model.common.dtos.PageResponseResult;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.pojo.ApUser;
import com.heima.model.wemedia.dtos.NewsAuthDto;
import com.heima.model.wemedia.dtos.WmSensitiveDto;
import com.heima.model.wemedia.pojos.WmChannel;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(value = "leadnews-wemedia")
public interface IWemediaClient {

    @PostMapping("/api/v1/sensitive/feign/save")
    public ResponseResult sensitiveSave(@RequestBody WmSensitiveDto dto);

    @PostMapping("/api/v1/sensitive/feign/update")
    public ResponseResult update(@RequestBody WmSensitiveDto dto);

    @PostMapping("/api/v1/sensitive/feign/list")
    public ResponseResult list(@RequestBody WmSensitiveDto dto);

    @DeleteMapping("/api/v1/sensitive/feign/del/{id}")
    public ResponseResult deleteById(@PathVariable Integer id);

    @PostMapping("/api/v1/wemedia/add")
    public ResponseResult addWmUser(@RequestBody ApUser apUser);

    /**
     * 查询文章审核表
     *
     * @param dto
     * @return
     */
    @PostMapping("/api/v1/wemedia/list_vo")
    public PageResponseResult mediaReviewList(@RequestBody NewsAuthDto dto);

    /**
     * 媒体审核之查看文章详情
     *
     * @param id
     * @return
     */
    @GetMapping("/api/v1/wemedia/detail/{id}")
    ResponseResult mediaDetail(@PathVariable Integer id);

    /**
     * 人工审核之拒绝
     * @param dto
     * @return
     */
    @PostMapping("/api/v1/wemedia/mediaAuthFail")
    ResponseResult mediaAuthFail(@RequestBody NewsAuthDto dto);

    /**
     * 人工审核之通过
     * @param dto
     * @return
     */
    @PostMapping("/api/v1/wemedia/mediaAuthPass")
    ResponseResult mediaAuthPass(@RequestBody NewsAuthDto dto);

    /**
     * 删除频道（feign远程调用）
     * @param id
     * @return
     */
    @GetMapping("/api/v1/channel/del/{id}")
    public ResponseResult deleteChannel(@PathVariable("id") Integer id);

    /**
     * 频道名称模糊分页查询（feign远程调用）
     * @param channelDto
     * @return
     */
    @PostMapping("/api/v1/channel/list")
    public PageResponseResult getChannelList(@RequestBody ChannelDto channelDto);

    /**
     * 保存频道（feign远程调用）
     * @param wmChannel
     * @return
     */
    @PostMapping("/api/v1/channel/save")
    public ResponseResult saveChannel(@RequestBody WmChannel wmChannel);

    /**
     * 修改频道（feign远程调用）
     * @param wmChannel
     * @return
     */
    @PostMapping("/api/v1/channel/update")
    public ResponseResult updateChannel(@RequestBody WmChannel wmChannel);

}
